| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
#include "asterisk.h" |
| 27 |
|
| 28 |
#include <pjsip.h> |
| 29 |
#include <pjsip_ua.h> |
| 30 |
|
| 31 |
#include "asterisk/res_pjsip.h" |
| 32 |
#include "asterisk/res_pjsip_session.h" |
| 33 |
#include "asterisk/channel.h" |
| 34 |
#include "asterisk/module.h" |
| 35 |
#include "asterisk/callerid.h" |
| 36 |
#include "asterisk/conversions.h" |
| 37 |
|
| 38 |
static int extract_oli(const pjsip_param *param_list, char *buf, size_t len) |
| 39 |
{ |
| 40 |
static const pj_str_t oli_str1 = { "isup-oli", 8 }; |
| 41 |
static const pj_str_t oli_str2 = { "ss7-oli", 7 }; |
| 42 |
static const pj_str_t oli_str3 = { "oli", 3 }; |
| 43 |
pjsip_param *oli; |
| 44 |
|
| 45 |
if ((oli = pjsip_param_find(param_list, &oli_str1)) |
| 46 |
|| (oli = pjsip_param_find(param_list, &oli_str2)) |
| 47 |
|| (oli = pjsip_param_find(param_list, &oli_str3))) { |
| 48 |
ast_copy_pj_str(buf, &oli->value, len); |
| 49 |
return 0; |
| 50 |
} |
| 51 |
return -1; |
| 52 |
} |
| 53 |
|
| 54 |
|
| 55 |
|
| 56 |
|
| 57 |
|
| 58 |
|
| 59 |
|
| 60 |
|
| 61 |
|
| 62 |
|
| 63 |
|
| 64 |
|
| 65 |
static int set_id_from_oli(pjsip_rx_data *rdata, int *ani2) |
| 66 |
{ |
| 67 |
char oli[AST_CHANNEL_NAME]; |
| 68 |
|
| 69 |
pjsip_fromto_hdr *from = pjsip_msg_find_hdr(rdata->msg_info.msg, |
| 70 |
PJSIP_H_FROM, rdata->msg_info.msg->hdr.next); |
| 71 |
|
| 72 |
if (!from) { |
| 73 |
return -1; |
| 74 |
} |
| 75 |
|
| 76 |
|
| 77 |
if (extract_oli(&from->other_param, oli, sizeof(oli))) { |
| 78 |
|
| 79 |
pjsip_sip_uri *uri; |
| 80 |
pjsip_name_addr *name_addr = (pjsip_name_addr *) from->uri; |
| 81 |
if (!ast_sip_is_uri_sip_sips(name_addr->uri)) { |
| 82 |
return -1; |
| 83 |
} |
| 84 |
uri = pjsip_uri_get_uri(name_addr->uri); |
| 85 |
if (extract_oli(&uri->other_param, oli, sizeof(oli))) { |
| 86 |
return -1; |
| 87 |
} |
| 88 |
} |
| 89 |
|
| 90 |
return ast_str_to_int(oli, ani2); |
| 91 |
} |
| 92 |
|
| 93 |
|
| 94 |
|
| 95 |
|
| 96 |
|
| 97 |
|
| 98 |
|
| 99 |
|
| 100 |
|
| 101 |
|
| 102 |
|
| 103 |
|
| 104 |
|
| 105 |
|
| 106 |
static int should_queue_connected_line_update(const struct ast_sip_session *session, const struct ast_party_id *id) |
| 107 |
{ |
| 108 |
|
| 109 |
if (!id->number.valid) { |
| 110 |
return 0; |
| 111 |
} |
| 112 |
|
| 113 |
|
| 114 |
|
| 115 |
|
| 116 |
|
| 117 |
if (ast_strlen_zero(session->id.number.str) || |
| 118 |
strcmp(session->id.number.str, id->number.str)) { |
| 119 |
return 1; |
| 120 |
} |
| 121 |
|
| 122 |
|
| 123 |
|
| 124 |
|
| 125 |
|
| 126 |
|
| 127 |
|
| 128 |
|
| 129 |
|
| 130 |
if (!id->name.valid) { |
| 131 |
return 0; |
| 132 |
} |
| 133 |
|
| 134 |
|
| 135 |
|
| 136 |
|
| 137 |
if (ast_strlen_zero(session->id.name.str) || |
| 138 |
strcmp(session->id.name.str, id->name.str)) { |
| 139 |
return 1; |
| 140 |
} |
| 141 |
|
| 142 |
|
| 143 |
return 0; |
| 144 |
} |
| 145 |
|
| 146 |
|
| 147 |
|
| 148 |
|
| 149 |
|
| 150 |
|
| 151 |
|
| 152 |
static void queue_connected_line_update(struct ast_sip_session *session, const struct ast_party_id *id) |
| 153 |
{ |
| 154 |
struct ast_party_connected_line connected; |
| 155 |
struct ast_party_caller caller; |
| 156 |
|
| 157 |
|
| 158 |
ast_party_connected_line_init(&connected); |
| 159 |
connected.id = *id; |
| 160 |
connected.id.tag = session->endpoint->id.self.tag; |
| 161 |
connected.source = AST_CONNECTED_LINE_UPDATE_SOURCE_ANSWER; |
| 162 |
|
| 163 |
|
| 164 |
ast_party_id_copy(&session->id, &connected.id); |
| 165 |
|
| 166 |
|
| 167 |
ast_party_caller_init(&caller); |
| 168 |
caller.id = connected.id; |
| 169 |
caller.ani = connected.id; |
| 170 |
caller.ani2 = ast_channel_caller(session->channel)->ani2; |
| 171 |
ast_channel_set_caller_event(session->channel, &caller, NULL); |
| 172 |
|
| 173 |
|
| 174 |
ast_channel_queue_connected_line_update(session->channel, &connected, NULL); |
| 175 |
} |
| 176 |
|
| 177 |
|
| 178 |
|
| 179 |
|
| 180 |
|
| 181 |
|
| 182 |
|
| 183 |
|
| 184 |
|
| 185 |
|
| 186 |
|
| 187 |
|
| 188 |
static void update_incoming_connected_line(struct ast_sip_session *session, pjsip_rx_data *rdata) |
| 189 |
{ |
| 190 |
struct ast_party_id id; |
| 191 |
|
| 192 |
if (!session->endpoint->id.trust_connected_line |
| 193 |
|| !session->endpoint->id.trust_inbound) { |
| 194 |
return; |
| 195 |
} |
| 196 |
|
| 197 |
ast_party_id_init(&id); |
| 198 |
if (!ast_sip_set_id_connected_line(rdata, &id)) { |
| 199 |
if (should_queue_connected_line_update(session, &id)) { |
| 200 |
queue_connected_line_update(session, &id); |
| 201 |
} |
| 202 |
} |
| 203 |
ast_party_id_free(&id); |
| 204 |
} |
| 205 |
|
| 206 |
|
| 207 |
|
| 208 |
|
| 209 |
|
| 210 |
|
| 211 |
|
| 212 |
|
| 213 |
|
| 214 |
|
| 215 |
|
| 216 |
|
| 217 |
|
| 218 |
static int caller_id_incoming_request(struct ast_sip_session *session, pjsip_rx_data *rdata) |
| 219 |
{ |
| 220 |
if (!session->channel) { |
| 221 |
int ani2; |
| 222 |
|
| 223 |
|
| 224 |
|
| 225 |
|
| 226 |
|
| 227 |
ast_sip_set_id_from_invite(rdata, &session->id, &session->endpoint->id.self, session->endpoint->id.trust_inbound); |
| 228 |
session->ani2 = set_id_from_oli(rdata, &ani2) ? 0 : ani2; |
| 229 |
} else { |
| 230 |
|
| 231 |
|
| 232 |
|
| 233 |
|
| 234 |
update_incoming_connected_line(session, rdata); |
| 235 |
} |
| 236 |
return 0; |
| 237 |
} |
| 238 |
|
| 239 |
|
| 240 |
|
| 241 |
|
| 242 |
|
| 243 |
|
| 244 |
|
| 245 |
|
| 246 |
|
| 247 |
|
| 248 |
static void caller_id_incoming_response(struct ast_sip_session *session, pjsip_rx_data *rdata) |
| 249 |
{ |
| 250 |
if (!session->channel) { |
| 251 |
return; |
| 252 |
} |
| 253 |
|
| 254 |
update_incoming_connected_line(session, rdata); |
| 255 |
} |
| 256 |
|
| 257 |
|
| 258 |
|
| 259 |
|
| 260 |
|
| 261 |
|
| 262 |
|
| 263 |
|
| 264 |
|
| 265 |
|
| 266 |
static pjsip_fromto_hdr *create_new_id_hdr(const pj_str_t *hdr_name, pjsip_fromto_hdr *base, pjsip_tx_data *tdata, const struct ast_party_id *id) |
| 267 |
{ |
| 268 |
pjsip_fromto_hdr *id_hdr; |
| 269 |
pjsip_name_addr *id_name_addr; |
| 270 |
pjsip_sip_uri *id_uri; |
| 271 |
|
| 272 |
id_hdr = pjsip_from_hdr_create(tdata->pool); |
| 273 |
id_hdr->type = PJSIP_H_OTHER; |
| 274 |
id_hdr->sname = id_hdr->name = *hdr_name; |
| 275 |
|
| 276 |
id_name_addr = pjsip_uri_clone(tdata->pool, base->uri); |
| 277 |
id_uri = pjsip_uri_get_uri(id_name_addr->uri); |
| 278 |
|
| 279 |
if (id->name.valid && !ast_strlen_zero(id->name.str)) { |
| 280 |
int name_buf_len = strlen(id->name.str) * 2 + 1; |
| 281 |
char *name_buf = ast_alloca(name_buf_len); |
| 282 |
|
| 283 |
ast_escape_quoted(id->name.str, name_buf, name_buf_len); |
| 284 |
pj_strdup2(tdata->pool, &id_name_addr->display, name_buf); |
| 285 |
} else { |
| 286 |
|
| 287 |
|
| 288 |
|
| 289 |
|
| 290 |
pj_strdup2(tdata->pool, &id_name_addr->display, NULL); |
| 291 |
} |
| 292 |
|
| 293 |
if (id->number.valid) { |
| 294 |
pj_strdup2(tdata->pool, &id_uri->user, id->number.str); |
| 295 |
} else { |
| 296 |
|
| 297 |
pj_strdup2(tdata->pool, &id_uri->user, NULL); |
| 298 |
} |
| 299 |
|
| 300 |
id_hdr->uri = (pjsip_uri *) id_name_addr; |
| 301 |
return id_hdr; |
| 302 |
} |
| 303 |
|
| 304 |
|
| 305 |
|
| 306 |
|
| 307 |
|
| 308 |
|
| 309 |
|
| 310 |
|
| 311 |
|
| 312 |
|
| 313 |
|
| 314 |
|
| 315 |
|
| 316 |
static void add_privacy_header(pjsip_tx_data *tdata, const struct ast_party_id *id) |
| 317 |
{ |
| 318 |
static const pj_str_t pj_privacy_name = { "Privacy", 7 }; |
| 319 |
static const pj_str_t pj_privacy_value = { "id", 2 }; |
| 320 |
pjsip_hdr *old_privacy; |
| 321 |
|
| 322 |
old_privacy = pjsip_msg_find_hdr_by_name(tdata->msg, &pj_privacy_name, NULL); |
| 323 |
|
| 324 |
if ((ast_party_id_presentation(id) & AST_PRES_RESTRICTION) == AST_PRES_ALLOWED) { |
| 325 |
if (old_privacy) { |
| 326 |
pj_list_erase(old_privacy); |
| 327 |
} |
| 328 |
} else if (!old_privacy) { |
| 329 |
pjsip_generic_string_hdr *privacy_hdr = pjsip_generic_string_hdr_create( |
| 330 |
tdata->pool, &pj_privacy_name, &pj_privacy_value); |
| 331 |
pjsip_msg_add_hdr(tdata->msg, (pjsip_hdr *)privacy_hdr); |
| 332 |
} |
| 333 |
} |
| 334 |
|
| 335 |
|
| 336 |
|
| 337 |
|
| 338 |
|
| 339 |
|
| 340 |
|
| 341 |
|
| 342 |
static void add_pai_header(const struct ast_sip_session *session, pjsip_tx_data *tdata, const struct ast_party_id *id) |
| 343 |
{ |
| 344 |
static const pj_str_t pj_pai_name = { "P-Asserted-Identity", 19 }; |
| 345 |
pjsip_fromto_hdr *base; |
| 346 |
pjsip_fromto_hdr *pai_hdr; |
| 347 |
pjsip_fromto_hdr *old_pai; |
| 348 |
|
| 349 |
|
| 350 |
|
| 351 |
|
| 352 |
old_pai = pjsip_msg_find_hdr_by_name(tdata->msg, &pj_pai_name, NULL); |
| 353 |
if (old_pai) { |
| 354 |
|
| 355 |
|
| 356 |
|
| 357 |
|
| 358 |
|
| 359 |
|
| 360 |
|
| 361 |
|
| 362 |
|
| 363 |
if (old_pai->type == PJSIP_H_OTHER) { |
| 364 |
pj_list_erase(old_pai); |
| 365 |
} else { |
| 366 |
ast_sip_modify_id_header(tdata->pool, old_pai, id); |
| 367 |
add_privacy_header(tdata, id); |
| 368 |
return; |
| 369 |
} |
| 370 |
} |
| 371 |
|
| 372 |
if (tdata->msg->type == PJSIP_REQUEST_MSG) { |
| 373 |
base = session->saved_from_hdr ? session->saved_from_hdr : PJSIP_MSG_FROM_HDR(tdata->msg); |
| 374 |
} else { |
| 375 |
base = PJSIP_MSG_TO_HDR(tdata->msg); |
| 376 |
} |
| 377 |
|
| 378 |
pai_hdr = create_new_id_hdr(&pj_pai_name, base, tdata, id); |
| 379 |
if (!pai_hdr) { |
| 380 |
return; |
| 381 |
} |
| 382 |
add_privacy_header(tdata, id); |
| 383 |
|
| 384 |
pjsip_msg_add_hdr(tdata->msg, (pjsip_hdr *)pai_hdr); |
| 385 |
} |
| 386 |
|
| 387 |
|
| 388 |
|
| 389 |
|
| 390 |
|
| 391 |
|
| 392 |
|
| 393 |
|
| 394 |
|
| 395 |
static void add_party_param(pjsip_tx_data *tdata, pjsip_fromto_hdr *hdr, const struct ast_sip_session *session) |
| 396 |
{ |
| 397 |
static const pj_str_t party_str = { "party", 5 }; |
| 398 |
static const pj_str_t calling_str = { "calling", 7 }; |
| 399 |
static const pj_str_t called_str = { "called", 6 }; |
| 400 |
pjsip_param *party; |
| 401 |
|
| 402 |
|
| 403 |
party = pjsip_param_find(&hdr->other_param, &party_str); |
| 404 |
if (party) { |
| 405 |
return; |
| 406 |
} |
| 407 |
|
| 408 |
party = PJ_POOL_ALLOC_T(tdata->pool, pjsip_param); |
| 409 |
party->name = party_str; |
| 410 |
party->value = (session->inv_session->role == PJSIP_ROLE_UAC) ? calling_str : called_str; |
| 411 |
pj_list_insert_before(&hdr->other_param, party); |
| 412 |
} |
| 413 |
|
| 414 |
|
| 415 |
|
| 416 |
|
| 417 |
|
| 418 |
|
| 419 |
|
| 420 |
|
| 421 |
|
| 422 |
|
| 423 |
|
| 424 |
|
| 425 |
|
| 426 |
static void add_privacy_params(pjsip_tx_data *tdata, pjsip_fromto_hdr *hdr, const struct ast_party_id *id) |
| 427 |
{ |
| 428 |
static const pj_str_t privacy_str = { "privacy", 7 }; |
| 429 |
static const pj_str_t screen_str = { "screen", 6 }; |
| 430 |
static const pj_str_t privacy_full_str = { "full", 4 }; |
| 431 |
static const pj_str_t privacy_off_str = { "off", 3 }; |
| 432 |
static const pj_str_t screen_yes_str = { "yes", 3 }; |
| 433 |
static const pj_str_t screen_no_str = { "no", 2 }; |
| 434 |
pjsip_param *old_privacy; |
| 435 |
pjsip_param *old_screen; |
| 436 |
pjsip_param *privacy; |
| 437 |
pjsip_param *screen; |
| 438 |
int presentation; |
| 439 |
|
| 440 |
old_privacy = pjsip_param_find(&hdr->other_param, &privacy_str); |
| 441 |
old_screen = pjsip_param_find(&hdr->other_param, &screen_str); |
| 442 |
|
| 443 |
if (!old_privacy) { |
| 444 |
privacy = PJ_POOL_ALLOC_T(tdata->pool, pjsip_param); |
| 445 |
privacy->name = privacy_str; |
| 446 |
pj_list_insert_before(&hdr->other_param, privacy); |
| 447 |
} else { |
| 448 |
privacy = old_privacy; |
| 449 |
} |
| 450 |
|
| 451 |
if (!old_screen) { |
| 452 |
screen = PJ_POOL_ALLOC_T(tdata->pool, pjsip_param); |
| 453 |
screen->name = screen_str; |
| 454 |
pj_list_insert_before(&hdr->other_param, screen); |
| 455 |
} else { |
| 456 |
screen = old_screen; |
| 457 |
} |
| 458 |
|
| 459 |
presentation = ast_party_id_presentation(id); |
| 460 |
if ((presentation & AST_PRES_RESTRICTION) == AST_PRES_ALLOWED) { |
| 461 |
privacy->value = privacy_off_str; |
| 462 |
} else { |
| 463 |
privacy->value = privacy_full_str; |
| 464 |
} |
| 465 |
if ((presentation & AST_PRES_NUMBER_TYPE) == AST_PRES_USER_NUMBER_PASSED_SCREEN) { |
| 466 |
screen->value = screen_yes_str; |
| 467 |
} else { |
| 468 |
screen->value = screen_no_str; |
| 469 |
} |
| 470 |
} |
| 471 |
|
| 472 |
|
| 473 |
|
| 474 |
|
| 475 |
|
| 476 |
|
| 477 |
|
| 478 |
|
| 479 |
static void add_rpid_header(const struct ast_sip_session *session, pjsip_tx_data *tdata, const struct ast_party_id *id) |
| 480 |
{ |
| 481 |
static const pj_str_t pj_rpid_name = { "Remote-Party-ID", 15 }; |
| 482 |
pjsip_fromto_hdr *base; |
| 483 |
pjsip_fromto_hdr *rpid_hdr; |
| 484 |
pjsip_fromto_hdr *old_rpid; |
| 485 |
|
| 486 |
|
| 487 |
|
| 488 |
|
| 489 |
old_rpid = pjsip_msg_find_hdr_by_name(tdata->msg, &pj_rpid_name, NULL); |
| 490 |
if (old_rpid) { |
| 491 |
|
| 492 |
|
| 493 |
|
| 494 |
|
| 495 |
|
| 496 |
|
| 497 |
|
| 498 |
|
| 499 |
|
| 500 |
if (old_rpid->type == PJSIP_H_OTHER) { |
| 501 |
pj_list_erase(old_rpid); |
| 502 |
} else { |
| 503 |
ast_sip_modify_id_header(tdata->pool, old_rpid, id); |
| 504 |
add_party_param(tdata, old_rpid, session); |
| 505 |
add_privacy_params(tdata, old_rpid, id); |
| 506 |
return; |
| 507 |
} |
| 508 |
} |
| 509 |
|
| 510 |
if (tdata->msg->type == PJSIP_REQUEST_MSG) { |
| 511 |
base = session->saved_from_hdr ? session->saved_from_hdr : PJSIP_MSG_FROM_HDR(tdata->msg); |
| 512 |
} else { |
| 513 |
base = PJSIP_MSG_TO_HDR(tdata->msg); |
| 514 |
} |
| 515 |
|
| 516 |
rpid_hdr = create_new_id_hdr(&pj_rpid_name, base, tdata, id); |
| 517 |
if (!rpid_hdr) { |
| 518 |
return; |
| 519 |
} |
| 520 |
add_party_param(tdata, rpid_hdr, session); |
| 521 |
add_privacy_params(tdata, rpid_hdr, id); |
| 522 |
pjsip_msg_add_hdr(tdata->msg, (pjsip_hdr *)rpid_hdr); |
| 523 |
} |
| 524 |
|
| 525 |
|
| 526 |
|
| 527 |
|
| 528 |
|
| 529 |
|
| 530 |
|
| 531 |
|
| 532 |
|
| 533 |
|
| 534 |
|
| 535 |
|
| 536 |
static void add_id_headers(const struct ast_sip_session *session, pjsip_tx_data *tdata, const struct ast_party_id *id) |
| 537 |
{ |
| 538 |
if (!ast_sip_can_present_connected_id(session, id)) { |
| 539 |
return; |
| 540 |
} |
| 541 |
if (session->endpoint->id.send_pai) { |
| 542 |
add_pai_header(session, tdata, id); |
| 543 |
} |
| 544 |
if (session->endpoint->id.send_rpid) { |
| 545 |
add_rpid_header(session, tdata, id); |
| 546 |
} |
| 547 |
} |
| 548 |
|
| 549 |
|
| 550 |
|
| 551 |
|
| 552 |
|
| 553 |
|
| 554 |
|
| 555 |
|
| 556 |
|
| 557 |
|
| 558 |
|
| 559 |
|
| 560 |
static void caller_id_outgoing_request(struct ast_sip_session *session, pjsip_tx_data *tdata) |
| 561 |
{ |
| 562 |
struct ast_party_id effective_id; |
| 563 |
struct ast_party_id connected_id; |
| 564 |
|
| 565 |
if (!session->channel) { |
| 566 |
return; |
| 567 |
} |
| 568 |
|
| 569 |
ast_party_id_init(&connected_id); |
| 570 |
ast_channel_lock(session->channel); |
| 571 |
effective_id = ast_channel_connected_effective_id(session->channel); |
| 572 |
ast_party_id_copy(&connected_id, &effective_id); |
| 573 |
ast_channel_unlock(session->channel); |
| 574 |
|
| 575 |
add_id_headers(session, tdata, &connected_id); |
| 576 |
ast_party_id_free(&connected_id); |
| 577 |
} |
| 578 |
|
| 579 |
|
| 580 |
|
| 581 |
|
| 582 |
|
| 583 |
|
| 584 |
|
| 585 |
|
| 586 |
|
| 587 |
|
| 588 |
static void caller_id_outgoing_response(struct ast_sip_session *session, pjsip_tx_data *tdata) |
| 589 |
{ |
| 590 |
struct ast_party_id effective_id; |
| 591 |
struct ast_party_id connected_id; |
| 592 |
|
| 593 |
if (!session->channel |
| 594 |
|| (!session->endpoint->id.send_connected_line |
| 595 |
&& session->inv_session |
| 596 |
&& session->inv_session->state >= PJSIP_INV_STATE_EARLY)) { |
| 597 |
return; |
| 598 |
} |
| 599 |
|
| 600 |
|
| 601 |
ast_party_id_init(&connected_id); |
| 602 |
ast_channel_lock(session->channel); |
| 603 |
effective_id = ast_channel_connected_effective_id(session->channel); |
| 604 |
ast_party_id_copy(&connected_id, &effective_id); |
| 605 |
ast_channel_unlock(session->channel); |
| 606 |
|
| 607 |
add_id_headers(session, tdata, &connected_id); |
| 608 |
ast_party_id_free(&connected_id); |
| 609 |
} |
| 610 |
|
| 611 |
static struct ast_sip_session_supplement caller_id_supplement = { |
| 612 |
.method = "INVITE,UPDATE", |
| 613 |
.priority = AST_SIP_SUPPLEMENT_PRIORITY_CHANNEL - 1000, |
| 614 |
.incoming_request = caller_id_incoming_request, |
| 615 |
.incoming_response = caller_id_incoming_response, |
| 616 |
.outgoing_request = caller_id_outgoing_request, |
| 617 |
.outgoing_response = caller_id_outgoing_response, |
| 618 |
}; |
| 619 |
|
| 620 |
static int load_module(void) |
| 621 |
{ |
| 622 |
ast_module_shutdown_ref(AST_MODULE_SELF); |
| 623 |
ast_sip_session_register_supplement(&caller_id_supplement); |
| 624 |
return AST_MODULE_LOAD_SUCCESS; |
| 625 |
} |
| 626 |
|
| 627 |
static int unload_module(void) |
| 628 |
{ |
| 629 |
ast_sip_session_unregister_supplement(&caller_id_supplement); |
| 630 |
return 0; |
| 631 |
} |
| 632 |
|
| 633 |
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "PJSIP Caller ID Support", |
| 634 |
.support_level = AST_MODULE_SUPPORT_CORE, |
| 635 |
.load = load_module, |
| 636 |
.unload = unload_module, |
| 637 |
.load_pri = AST_MODPRI_APP_DEPEND, |
| 638 |
.requires = "res_pjsip,res_pjsip_session", |
| 639 |
); |